package gmiddleware

import (
	"github.com/gofiber/fiber/v2"
	"github.com/gofiber/fiber/v2/middleware/logger"
)

// 创建 Logger日志处理器
func Logger() fiber.Handler {
	// 获取默认log配置
	config := logger.ConfigDefault

	// 自定义跨域配置
	config.Format = "${time} ${status} - ${latency} ${method} ${path} \n"
	config.TimeFormat = "2006/01/02 - 15:04:05"
	return logger.New(config)
	// logger.New(logger.Config{ Format: "[${ip}]:${port} ${status} - ${method} ${path}\n", })
}
